<?php
	$config_uri = dirname(__FILE__) . "/config.php";
	@require_once($config_uri);

	$functions_uri = dirname(__FILE__) . "/functions.php";
	@require_once($functions_uri);

	drizzo_db_connect();

	$id = $_GET['user_id'];
	
	$query = "SELECT `avatar` FROM `$drizzo_users` WHERE `ID`='$id' LIMIT 1";
	$result = @mysql_query($query);

	$data = @mysql_fetch_assoc($result);
	$data = $data['avatar'];

	if($data) {
		header("Content-type: image");
		echo $data;
		return true;
	} else {
		header("HTTP/1.0 404 Not Found");
		return false;
	}
?>
